﻿@model IRIS.Models.EventMonthViewModel

@{
    ViewBag.Title = "Date";
}

@section SubMenu
{
    <ul>
        <li>@Html.ActionLink("Janúar", "Date", "Events", new { theMonth = 1, theYear=DateTime.Now.Year , theMonthName = "Janúar" },null)</li>
        <li>@Html.ActionLink("Febrúar", "Date", "Events", new { theMonth = 2, theYear = DateTime.Now.Year, theMonthName = "Febrúar" }, null)</li>
        <li>@Html.ActionLink("Mars", "Date", "Events", new { theMonth = 3, theYear=DateTime.Now.Year , theMonthName = "Mars" },null)</li>
        <li>@Html.ActionLink("Apríl", "Date", "Events", new { theMonth = 4, theYear = DateTime.Now.Year, theMonthName = "Apríl" }, null)</li>
        <li>@Html.ActionLink("Maí", "Date", "Events", new { theMonth = 5, theYear = DateTime.Now.Year, theMonthName = "Maí" }, null)</li>
        <li>@Html.ActionLink("Júní", "Date", "Events", new { theMonth = 6, theYear = DateTime.Now.Year, theMonthName = "Júní" }, null)</li>
        <li>@Html.ActionLink("Júlí", "Date", "Events", new { theMonth = 7, theYear = DateTime.Now.Year, theMonthName = "Júlí" }, null)</li>
        <li>@Html.ActionLink("Ágúst", "Date", "Events", new { theMonth = 8, theYear = DateTime.Now.Year, theMonthName = "Ágúst" }, null)</li>
        <li>@Html.ActionLink("September", "Date", "Events", new { theMonth = 9, theYear = DateTime.Now.Year, theMonthName = "September" }, null)</li>
        <li>@Html.ActionLink("Október", "Date", "Events", new { theMonth = 10, theYear = DateTime.Now.Year, theMonthName = "Október" }, null)</li>
        <li>@Html.ActionLink("Nóvember", "Date", "Events", new { theMonth = 11, theYear = DateTime.Now.Year, theMonthName = "Nóvember" }, null)</li>
        <li>@Html.ActionLink("Desember", "Date", "Events", new { theMonth = 12, theYear=DateTime.Now.Year, theMonthName = "Desember" },null)</li>
    </ul>
}
@if (Model.m_month != null)
{
    <h2> @Model.m_month</h2>
}

<table>
    <tr>
        <th>
            Titill
        </th>
        <th>
            Dagsetning
        </th>
        <th>
            Staðsetning
        </th>
        @if (User.IsInRole("Stjórnendur"))
        {
            <th>
                Stjórnborð
            </th>
        }
    </tr>

@foreach (var item in Model.m_event) {
    <tr>
        <td>
            @Html.ActionLink(item.Title, "Details", new { id = item.ID }) </td>
        <td>
            @Html.DisplayFor(modelItem => item.EventDate) 
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Location)
        </td>
        @if (User.IsInRole("Stjórnendur"))
        {
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ID })
            </td>
        }
    </tr>
}

</table>
